<template>
  <div>
    <div id="main" :style="{backgroundImage: 'url(' + URL + ')'}">
      <div>
        <wx-math/>
      </div>
    </div>
  </div>
</template>

<script>
import WxMath from './childComps/WxMath'

export default {
  name: '',
  data() {
    return {
      URL: 'https://wx2.sinaimg.cn/large/006yjJnHgy1gebtru6lp4j311i0u0u0x.jpg',
      urlday: 'https://wx2.sinaimg.cn/large/006yjJnHgy1gebtru6lp4j311i0u0u0x.jpg',
      urlnight: 'https://wx4.sinaimg.cn/large/006yjJnHgy1geby1ibe1bj31900u0x6q.jpg',
    };
  },
  components:{
    WxMath
  },
  watch:{
  },
  methods: {},
  computed:{
    nightData() {
      return this.$store.state.isNight
    }
  },
  watch:{
    nightData(newData, oldData) {
      if(newData){
        this.URL = this.urlday
      } else {
        this.URL = this.urlnight
      }
    }
  }
};
</script>

<style scoped>
#main {
  height: 100%;
  width: 99vw;
  padding-left: 1vw;
  /* background: url(https://wx2.sinaimg.cn/large/006yjJnHgy1gebtru6lp4j311i0u0u0x.jpg); */
  /* background: url(./img/bg.jpg); */
  background-size: 100% 107%;
}
</style>
